package com.sptpc.demo1. model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.time.LocalDate;

@Entity//
@Table(name = "t_student")//指定表名为t_drink

@Data
@NoArgsConstructor//创建无参构造函数
@AllArgsConstructor //创建全参构造函数
@Builder
public class Student {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)//设置为自增字段
    public Long id;

    @Column(name = "name")//指定表中的字段名。如果与数据库字段名相同可省略不写
    public String name;

    @Column(name = "major")
    public String major;

    @Column(name = "adminssjon_date")
    public LocalDate adminssjonDate;
}
